package com.huawei.appgallery.assistantdock.gamemode.card;

import android.content.Context;
import android.content.Intent;
import android.view.View.OnClickListener;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.beo$d;
import o.beo.f;
import o.bif.d;
import o.big;
import o.Logger;
import o.ezn;
import o.fam;

public class ScreenRecordEnterCardBuoy extends BuoyBaseEnterCard implements OnClickListener {
    public ScreenRecordEnterCardBuoy(Context context) {
        super(context);
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        this.ˊ.setText(f.ͺॱ);
        this.ʼ.setBackgroundResource(beo$d.ˏˎ);
    }

    public void ˋ() {
        if (fam.ॱ().ˏ() != null) {
            ˏ("CLICK");
            try {
                if (big.ʽ()) {
                    Logger.ˎ("ScreenRecordEnterCardBuoy", "has Installed system screen record, start service");
                    fam.ॱ().ˏ(this.ʼॱ);
                    Intent intent = new Intent("com.huawei.screenrecorder.Start");
                    intent.setClassName("com.huawei.screenrecorder", "com.huawei.screenrecorder.ScreenRecordService");
                    if (this.ʼॱ.startService(intent) == null) {
                        Logger.ˎ("ScreenRecordEnterCardBuoy", "componentName == null, start screen record activity");
                        intent = new Intent("com.huawei.screenrecorder.intent.action.LMT_ScreenRecorder");
                        intent.setPackage("com.huawei.screenrecorder");
                        intent.addFlags(268435456);
                        this.ʼॱ.startActivity(intent);
                        return;
                    }
                    return;
                }
                ezn.ˊ().ˊ(this.ʼॱ.getString(f.ͺ));
            } catch (Throwable th) {
                Logger.ˋ("ScreenRecordEnterCardBuoy", "start screen record throwable", th);
            }
        } else if (Logger.ˎ()) {
            Logger.ˏ("ScreenRecordEnterCardBuoy", "gameInfo is null");
        }
    }

    String ᐝ() {
        return d.GSS_SCREEN_RECORD.ˊ();
    }
}
